package zero.tech.games.logic.data;

import java.util.HashMap;
import java.util.Map;

import zero.tech.core.data.SimpleUser;
import zero.tech.games.common.data.AIRoomNodeConfig;

public class ServerData {
	public static volatile int ALL_GAME_OPEN_SWITCH=1;//全部游戏停服
	public static volatile Map<Integer,Boolean> map=new HashMap<>();//按游戏id停服
	public static volatile Map<String,AIRoomNodeConfig> ai_roomnode_map=new HashMap<>();//ai房间节点
	public static volatile Map<Integer,SimpleUser> robot_map=new HashMap<>();//机器人数据

	public static boolean isClosed(int game_id) {
		if(ALL_GAME_OPEN_SWITCH==0) {
			return true;
		}
		if(map.containsKey(game_id)) {
			boolean open=map.get(game_id);
			if(!open) {
				return true;
			}
		}
		return false;
	}

	public static void changeSwitchByGameId(int game_id, boolean open) {
		map.put(game_id, open);
	}

	public static void changeAiRoomNodeMap(String key, AIRoomNodeConfig aiRoomNodeConfig) {
		ai_roomnode_map.put(key, aiRoomNodeConfig);
	}
}
